function showTime(){
    var d = new Date();
    var str = "";
    str += d.getFullYear()+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日";
    str += " "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
    if(d.getHours() < 12){
        $("#day").html("上午好!")
    }else{
        $("#day").html("下午好!")
    }
    switch (d.getDay()){
        case 0:
            str += "星期天";
            break;
        case 1:
            str += "星期一";
            break;
        case 2:
            str += "星期二";
            break;
        case 3:
            str += "星期三";
            break;
        case 4:
            str += "星期四";
            break;
        case 5:
            str += "星期五";
            break
        case 6:
            str += "星期六";
            break;
    }

    $("#time").html(str);
}

setInterval("showTime()",1000);